package com.qiyu.tech.pay.service;

import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

/**
 * @Author linhao
 * @Date created in 10:30 上午 2021/4/4
 */
@Component
public class UnionIdService {

    public static String unionIdUrl = "http://localhost:8082/id-builder/increase-id?code=1";

    public Long getUnionId() {
        RestTemplate restTemplate = new RestTemplate();
        Long id = Long.valueOf(restTemplate.getForObject(unionIdUrl, String.class));
        return id;
    }
}
